//
//  Model.m
//  quickLook
//
//  Created by J on 15/8/30.
//  Copyright (c) 2015年 JZJ. All rights reserved.
//

#import "Model.h"

@implementation Model

- (instancetype)initWithDic:(NSDictionary*)dic
{

    if (self=[super init]) {
        
        _Description=dic[@"description"];
        
        
    }
    return self;
}

- (instancetype)initWithArray:(NSDictionary *)dic{


    if (self=[super init]) {
        
        
        
        
        _url=dic[@"url"];


        _comments_count=dic[@"comments_count"];
        
        _cover_image_url=dic[@"cover_image_url"];
        _created_at=dic[@"created_at"];
        _id=dic[@"id"];
        
        
//        _is_liked=dic[@"is_liked"];

        _likes_count=dic[@"likes_count"];
        
        _shared_count=dic[@"shared_count"];
        
        
        

        
        _title=dic[@"title"];
        
        
        /**
         *  topic
         */
        
        
        _topic=dic[@"topic"];
        
        
        
        _comics_count=_topic[@"comics_count"];
        
        
        _topicCover_image_url=_topic[@"_topicCover_image_url"];
        
        
        
//        _description=_topic[@"description"];
        _topicId=_topic[@"id"];
        
        
        _topicTitle=_topic[@"title"];
        
        _updated_at=_topic[@"updated_at"];
        _vertical_image_url=_topic[@"vertical_image_url"];
        
        
        /**
         *  user
         */
        
        _user=_topic[@"user"];
        
        
        _userAvatar_url=_user[@"avatar_url"];
        
        _userId=_user[@"id"];

        _nickname=_user[@"nickname"];

        _reg_type=_user[@"reg_type"];

     
        
    }
    
    return self;
    
    
}


- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    JZJLog(@"%@",key);
    if ([key isEqualToString:@"description"]) {
        _Description= value;
    }
}


- (id)valueForUndefinedKey:(NSString *)key{

    return key;

}

@end
